package com.jeomo.sys.provider.web.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.jeomo.common.core.dto.ITree;
import com.jeomo.sys.api.enums.OrgStatusEnum;
import com.jeomo.sys.api.enums.OrgTypeEnum;

import java.util.List;

/**
 * <h3>jeomo</h3>
 * <p>组织树，以树形结构展现树</p>
 *
 * @author : qibotian
 * @date : 2020-09-25 10:26
 **/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrgTreeVo implements ITree {

    private String code;

    private String name;

    private String fullName;

    private OrgTypeEnum type;

    private OrgStatusEnum status;

    private String parentCode;

    private List<OrgTreeVo> children;

    //*********************** getter setter **********************

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public OrgStatusEnum getStatus() {
        return status;
    }

    public void setStatus(OrgStatusEnum status) {
        this.status = status;
    }

    public List<OrgTreeVo> getChildren() {
        return children;
    }

    public void setChildren(List<OrgTreeVo> children) {
        this.children = children;
    }

    public String getParentCode() {
        return parentCode;
    }

    public void setParentCode(String parentCode) {
        this.parentCode = parentCode;
    }

    public OrgTypeEnum getType() {
        return type;
    }

    public void setType(OrgTypeEnum type) {
        this.type = type;
    }

    @Override
    public boolean isGroup() {
        return OrgTypeEnum.MALL_GROUP.equals(getType());
    }

    @Override
    public Object getGroupTypeValue() {
        return OrgTypeEnum.MALL_GROUP;
    }
}
